<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>进度条</title>
    <style>
        .box {
            height: 20px;
            width: 400px;
            border: 3px solid #222;
            border-radius: 15px;
            background-color: #444;
            margin-bottom: 30px;
        }

        .inner {
            position: relative;
            width: 50%;
            height: 100%;
            background-color: yellow;
            border-radius: 10px;
            text-align: right;
            transition: width 1s;
        }

        span {
            position: absolute;
            right: -20px;
            bottom: -25px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="box">
            <div class="inner" :style="{width:progress+'%'}">
                <span>{{progress}}%</span>
            </div>
        </div>
        <button @click="progress=25">进度25%</button>
        <button @click="progress=50">进度50%</button>
        <button @click="progress=75">进度75%</button>
        <button @click="progress=100">进度100%</button>
    </div>

    <script src="./script/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                progress: 50
            }
        })
    </script>
</body>

</html>